<?php
// +----------------------------------------------------------------------
//            -------------------------
//           /   / ----------------\  \
//          /   /             \  \
//         /   /              /  /
//        /   /    /-------------- /  /
//       /   /    /-------------------\  \
//      /   /                   \  \
//     /   /                     \  \
//    /   /                      /  /
//   /   /      /----------------------- /  /
//  /-----/      /---------------------------/
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://baimifan.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: Sage 2016/7/1  14:37
// +----------------------------------------------------------------------
namespace Common\Model;
use Think\Model\ViewModel;

class OrderBookView  extends ViewModel{
    protected $tableName ='Order_book';
    public $viewFields = array(
        'Order_book'=>array('order_id', 'user_id', 'money', 'price_freight', 'type', 'address', 'state_order', 'pay_id', 'create_time', 'is_freightfree', 'discount_buy', 'is_refund', 'is_online', 'refund_id', 'order_remark','_type'=>'LEFT'),
        'Order_has_book'=>array('order_has_book_id', 'book_id', 'quantity', 'type', 'is_backed', 'num_backed', 'num_broken', 'is_apprised', 'book_detail','_on'=>'Order_has_book.order_id=Order_book.order_id','_type'=>'LEFT'),
        'Book'=>array( 'tm', 'isbn', 'spbs', 'sm', 'zyz', 'dj', 'bb', 'cbrq', 'ysny', 'jlrq', 'yxxl', 'yc', 'bc', 'kb', 'press_id', 'stock_rent', 'sort', 'bdetail', 'b_rec', 'b_logo', 'stock_buy', 'press', 'is_del','_on'=>'Order_has_book.book_id=Book.book_id','_type'=>'LEFT'),
        'Card'=>array('card_id','_on'=>'Card.user_id=Order_book.user_id')
    );
}